Digital cameras (hereinafter referred to as cameras) may be used for capturing images. With the advancement in technology, digital cameras are implemented in almost all types of digital devices. Examples of such digital devices include, but are not limited to, mobile communication device, a tablet, a laptop, and a Personal Digital Assistant (PDA). In many instances, the cameras may serve as an alternative for a document scanner as the cameras can be used to capture images of a document. The images of the document may have to be processed before text recognition and/or text extraction. Processing of the images of the document imposes two main challenges: poor image quality of the captured images due to unfavourable imaging conditions, and distortion in the captured images. The distortion may be due to the camera, and/or angle and positions of the camera relative to a plane of the document while capturing the images. The distortion due to the latter is known as projective distortion. In projective distortion, text symptoms or characters appear larger closer to the camera plane, and appear to decrease in size farther away. There are known techniques for improving the quality of the images. However, improving the quality of images may not aid in recognition and/or extraction of text when the images of the documents are, in particular, projective distorted. The projective distortion not only disturbs visual interpretation of the text but also affects accuracy of text recognition algorithms.
There are existing techniques for correcting the projective distortion. One of the currently known techniques for performing correction of projective distortion uses auxiliary data. The auxiliary data may include a combination of orientation measurement data, accelerometer data and distance measurement data. However, such auxiliary data may not be available in all the electronic devices due to lack of various sensors and/or processing capabilities. Some other techniques discuss manual correction of projective distortion. One such technique requires a user to manually identify and mark four corners of a quadrilateral that used to be a rectangle formulated by two horizontal line segments and two vertical line segments before the distortion. Another technique requires the user to identify and mark parallel lines that correspond to horizontal lines or vertical lines before the distortion. Based on the corners or parallel lines, correction of the projective distortion is performed. However, the manual correction of projective distortion is time-consuming, inefficient, and error-prone.
Techniques for automatic correction of projective distortions algorithms also exist. These techniques focus on identifying horizontal and vertical vanishing points. The vanishing points may refer to points where contours (for example, horizontal contours or vertical contours) of the document in the image converge to a point. The techniques use the horizontal and the vertical vanishing points to perform correction of projective distortion. However, most of the techniques require complicated manual parameter settings for the correction. If the content of the image changes, the parameters have to be changed manually. This limits the capability of the techniques. Further, the existing techniques are computationally expensive making it difficult to implement in small devices, such as, mobile communication devices. Furthermore, most of the techniques work on an assumption that the document images comprise only text. In case of the document images having a combination of text and pictures, the techniques may not produce useful results or results at all. Also, many of the techniques work on an assumption that the text in the images of document are formatted and/or positioned in a particular manner. So when the text in the images are not formatted and/or positioned in the particular manner, the techniques fail.